<include file="Common/works/header" />
<include file="Common/works/left_menu" />
<link href="__PUBLIC__/home/css/bootstrap.min.css" rel="stylesheet"/>
<link href="__PUBLIC__/home/css/uploads_pic/cropper.min.css" rel="stylesheet"/>
<link href="__PUBLIC__/home/css/uploads_pic/main.css" rel="stylesheet"/>

<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/waitMe.css" />
<!-- <link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/webuploader.css" /> -->
<!-- <link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/css.css" /> -->
<style type="text/css"> 
.webuploader-pick { width: 148px; height:88px; z-index: -9999;}
</style> 

  <div class="right" method="post" id="tab1" name="tab1">
    <div class="faservice_title"><a href="/apiworks/index.html" title="我的服务">我的服务</a>&nbsp;&gt;&nbsp;编辑服务</div>
    <div class="faservice">
      <div class="column">
        <div class="field">服务名称:</div>
        <input name="service_name" id="service_name" class="kt1 fl _service_name _blur_rz" opt-tip="请输入服务名称" value="{$info.service_name}" placeholder="请填写服务名称，用于交易市场显示" />
			<div id="service_name_id" class="error hide">
				<i></i><span id="service_name_msg"></span>
			</div>     
      </div>
      <div class="column">
        <div class="field">英文名称:</div>
            <input name="service_name_en" disabled="disabled" id="service_name_en" class="kt1 fl _service_name_en _blur_rz" value="{$info.service_name_en}" opt-tip="请输入服务英文名称"  autocomplete="on" placeholder="请填写英文名称，用于交易市场显示" />
			<div id="service_name_en_id" class="error hide">
				<i></i><span id="service_name_en_msg" ></span>
			</div>  
            <div class="cls"></div>
      
      </div>
      <div class="column">
        <div class="fieldd">英文名称用于生成云途数据的API地址： https://api.37degree.com/open/<span style=" color:#1080f2">service_name</span>/api_name 保存后不能修改</div>
      </div>
      
      <div class="cls"></div>
      <div class="column">
        <div class="field">服务介绍:</div>
        <textarea name="service_introduction" id="service_introduction" class="textarea fl _service_introduction _blur_rz"  opt-tip="请输入服务介绍" maxlength="250" />{$info.service_introduction}</textarea>
			<div class="error hide" style="margin-top: 36px" id="service_introduction_id">
				<i></i><span id="service_introduction_msg"></span>
			</div>   
            <div class="cls"></div>   
      </div>
      
      <div class="column">
        <div class="field">服务分类:</div>
        <select id="selected_category" class="class _selecte_category_list fl margin-right-15">
			</select>
			<!--9-6添加-->
			<div class="_secList">
				<select id="select-crumbs2" class="class _selecte_category_list fl">
				</select>
			</div>
			<!--添加end-->
        <div class="error hide" id="selected_category_id">
          <i></i><span id="selected_category_msg">请选择服务分类</span>
        </div>
        <div class="cls"></div>
      </div>
        
		<div class="column">
			<div class="field">服务LOGO:</div>
			<div class="fl">
                <div id="crop-avatar">
                    <!-- Current avatar -->
                    
                    
      
                    <div class="avatar-view" title="图片上传">
                        <img style="background:url('__PUBLIC__/home/images/scan.jpg');" src="{$info.service_logo}" class="fl" alt="Avatar" id="pic"/>
                        <input type="hidden" value="{$info.service_logo}" class="_service_logo" />
                    </div>
        
                    <!-- Cropping modal -->
                    <div class="modal fade" id="avatar-modal" aria-hidden="true" aria-labelledby="avatar-modal-label" role="dialog" tabindex="-1">
                        <div class="modal-dialog modal-lg">
                            <div class="modal-content">
                                <form class="avatar-form" action="/common/imageUpload.html" enctype="multipart/form-data" method="post">
                                    <div class="modal-header">
                                        <button class="close" data-dismiss="modal" type="button">&times;</button>
                                        <h4 class="modal-title" id="avatar-modal-label">LOGO上传</h4>
                                    </div>
                                    <div class="modal-body">
                                        <div class="avatar-body">
        
                                            <!-- Upload image and data -->
                                            <div class="avatar-upload">
                                                <input class="avatar-src" name="avatar_src" type="hidden"/>
                                                <input class="avatar-data" name="avatar_data" type="hidden"/>
                                                <label for="avatarInput">图片选择</label>
                                                <input class="avatar-input" id="avatarInput" name="avatar_file" type="file"/>
                                                <div class="avatar-upload-tip"></div>
                                            </div>
        
                                            <!-- Crop and preview -->
                                            <div class="row">
                                                <div class="col-sm-8">
                                                    <div class="avatar-wrapper"></div>
                                                </div>
                                                <div class="col-sm-4 center-block">
                                                  <div style="padding:0 15px;">
                                                  
                                                    <div class="avatar-preview preview-lg container"  title="图片上传" onclick="displayDate()"> 
                                                      <img src="__PUBLIC__/home/images/scan.jpg"/>
                                                    </div>
                                                    <div class="avatar-preview preview-md container"  title="图片上传" onclick="displayDate()">
                                                      <img src="__PUBLIC__/home/images/scan.jpg"/>
                                                    </div>
                                                    
                                                    <div class="avatar-btns">
                                                        <div class="col-md-11 container" >
                                                            <button class="btn btn-primary btn-block avatar-save" type="submit">完成</button>
                                                        </div>
                                                    </div>
                                                  </div>
                                                </div>
                                            </div>
                                            <script>
                                            function displayDate(){
                                              document.getElementById("avatarInput").click();
                                            }
											document.getElementById("pic").click(
											);
                                            </script>
                                        </div>
                                    </div>
                                    <!-- <div class="modal-footer">
                                      <button class="btn btn-default" data-dismiss="modal" type="button">Close</button>
                                    </div> -->
                                </form>
                            </div>
                        </div>
                    </div><!-- /.modal -->
        
                    <!-- Loading state -->
                    <div class="loading" aria-label="Loading" role="img" tabindex="-1"></div>
                </div>
				<div class="upload">图片大小280*242px，不超过500k，格式仅支持jpg，png，gif</div>
			</div>
			<div class="error hide" id="file_upload_id" style="margin-top: 36px">
				<i></i><span id="file_upload_msg"></span>
			</div>
		</div>
      <div class="column">
      <div class="fieldt fl">请求协议:</div>
      <div class="classification">
        <input name="service_proto" class="xz _service_host_protol" type="radio" value="http" <if condition="$info.service_proto eq 'http' ">checked="checked"</if> /> HTTP
      </div>
      <div class="classification">
        <input name="service_proto" class="xz _service_host_protol" type="radio" value="ice" <if condition="$info.service_proto eq 'ice' ">checked="checked"</if>/> ICE
      </div>
      <div class="cls"></div>
    </div>

      <div class="column">
        <div class="field">服务域名:</div>
             <div class="slurl">
				<span id="protol_id">http</span>://<span><input name="service_host" id="service_host" class="kt7 _service_host _blur_rz" value="{$info.service_host}" placeholder="www.37degree.com" opt-tip="请输入服务域名" autocomplete="on" /></span>
			</div>       
			<div id="service_host_id" class="error hide">
				<i></i><span id="service_host_msg"></span>
			</div>	       
        <div class="cls"></div>
      </div>
      
      <div class="column">
        <div class="fieldd">例如: www.37degree.com (开头不带http/https,末尾不带 "/" ),该服务下所有API都使用此域名</div>
      </div>

      
        <div class="panel-group" id="accordion">
         <div class="panel panel-default">
          <div class="panel-heading">
            <h4 class="panel-title">
              <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
                  高级设置
              </a>
            </h4>
          </div>
          <div id="collapseOne" class="panel-collapse collapse">
          
          
              <div class="column">
                <div class="field">超时时间:</div>
                <input name="service_timeout" id="service_timeout" class="kt1 fl _service_timeout _blur_rz" value="{$info.service_timeout}" autocomplete="on"  maxlength="50" placeholder="3000" style="width:100px"/>
                <div class="commentaryt">毫秒（建议不超过5000毫秒）</div>
                    <div id="service_host_id" class="error hide">
                        <i></i><span id="service_host_msg"></span>
                    </div>       
                <div class="cls"></div>
              </div>
              <div class="column">
                <div class="fieldt fl">Request Headers:</div>
                <div class="commentaryt">（http 响应开头，非必填）</div>
                <div class="cls"></div>
              </div>
        
              <div class="column">
                <div class="table-top">
                  <div class="tab">参数</div>
                  <div class="tab">值</div>
                </div>
                
                <!-- 循环 -->
                <div jput="jput_format_request" jput-jsondata='[]'>
                <div class="_raw_request_head">
                <div class="table-foot fl">
                  <div class="tab">
                    <input name="request['name']" id="name1" value="{{json.name}}" class="kt5" autocomplete="on"  maxlength="50" onblur="javascript:checkValue(this);return false;" onfocus="javascript:rmError(this);return false;"/>
                  </div>
                  <div class="tab">
                    <input name="request['value']" id="email1" value="{{json.value}}" class="kt5" autocomplete="on"/>
                  </div>
                </div>
                <div class="commentaryy"><a href="javascript:void(0)" class="_request_head_del">删除</a></div>
                </div>
                </div>
                <!-- 循环 -->
                
              </div>
        
              <div class="cls"></div>
              <div class="column" style="height:50px; margin-top:16px">
                <a href="javascript:void(0)" id="save1" class="cobed _add_request_headers" title="继续添加">继续添加</a>
                <input type="hidden" value="" class="_request_headers_json" />
              </div>
        
              <div class="column">
                <div class="fieldt fl">Response Headers:</div>
                <div class="commentaryt">（ http 响应开头，非必填）</div>
                <div class="cls"></div>
              </div>
              <div class="column">
                <div class="table-top">
                  <div class="tab">参数</div>
                  <div class="tab">值</div>
                </div>
                
                <!-- 循环 -->
                <div jput="jput_format_response" jput-jsondata='[]'>
                <div class="_raw_response_head">
                <div class="table-foot fl">
                    <div class="tab">
                      <input name="response['name']" id="name2" value="{{json.name}}" class="kt5" autocomplete="on"  maxlength="50" onblur="javascript:checkValue(this);return false;" onfocus="javascript:rmError(this);return false;"/>
                    </div>
                    <div class="tab">
                      <input name="response['value']" id="email2"  value="{{json.value}}" class="kt5" autocomplete="on"/>
                    </div>
                  </div>
                  <div class="commentaryy"><a href="javascript:void(0)" class="_response_head_del">删除</a></div>
                  </div>
                </div>
                <!-- 循环 -->
                
              </div>
              <div class="cls"></div>
              <div class="column" style="height:50px; margin-top:16px">
                <a href="javascript:void(0)" id="save2" class="cobed _add_response_headers" title="继续添加">继续添加</a>
                <input type="hidden" value="" class="_response_headers_json" />
              </div>
     
     
     
           </div>
         </div>
        </div>
      
      <div class="column">
        <button type="button" class="confirm _add_confirm" data-id="add_api" id="register">确定</button>
      </div>
      <div class="cls"></div>
    </div>
  </div>
</div>
<input type="hidden" value="{$info.service_id}" class="_service_id" />
<input type="hidden" value='{$json_category_string}' class='_categoryObj' />
<input type="hidden" value="{$cid}" class="_firstCateId"/>
<input type="hidden" value="{$tid}"  class="_secCateId"/>
</body>
<script src="__PUBLIC__/home/js/jquery.1.11.min.js"></script>
<script src="__PUBLIC__/home/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/home/js/uploads_pic/cropper.min.js"></script>
<script src="__PUBLIC__/home/js/uploads_pic/main.js"></script>
        
<script type="text/javascript" src="__PUBLIC__/home/js/serviceapi_common.js"></script>
<script type="text/javascript" src="__PUBLIC__/home/js/webuploader.js"></script>
<script src="__PUBLIC__/js/common.js" type="text/javascript"></script>
<script src="__PUBLIC__/home/js/jput-2.js"></script>
<script type="text/javascript" src="__PUBLIC__/home/js/serviceedit.js"></script>
<script language="javascript" type="text/javascript" src="__PUBLIC__/js/jquery.selectlist.js"></script>
<script>
$(function (){
////select样式
//$('._selecte_category_list').selectlist({
//    zIndex: 10,
//    width: 150,
//    height: 40
//  }); 

	 //组装request head数据
	 var req_head = <?php echo json_encode($info['service_request_heads']); ?>;
	 request_head(req_head);
	 
	 var resp_head = <?php echo json_encode($info['service_response_heads']); ?>;
	 //组装response head
	 response_head(resp_head);
});

</script>
<script src="__PUBLIC__/home/js/waitMe.js"></script>
</html>
